package edu.sctu.practice.zhengsenwen.assign.assign03.test02;

/**
 * Created by zhengsenwen on 2015/10/29.
 */
public class ComparableCylinder extends Cylinder implements Comparable {

//            （4）创建类ComparableCylinder，该类为Cylinder类的子类，并实现Comparable接口。

    public ComparableCylinder(float redius, float height) {
        super(redius, height);
    }

    @Override
    public int compareTo(Object object) {
        if (getArea(2.0f, 3.0f) > ((ComparableCircle) object).getArea(2.0f)) {
            return 0;
        }
        return 1;
    }
}